package com.bolun998300.personal_blog_springboot.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bolun998300.personal_blog_springboot.dao.BloggerDao;
import com.bolun998300.personal_blog_springboot.pojo.Blogger;

@Service
public class BloggerService {
	
	@Autowired
	private BloggerDao bloggerDao;

	public Blogger get(int id) {
		return  bloggerDao.findOne(id);
	}
	
	public void update(Blogger bean) {
		bloggerDao.save(bean);
	}

	public Blogger getByName(String bloggerName) {
		
		return bloggerDao.findByUserName(bloggerName);
	}
	
}
